<template>
    <div>
<h1>支付成功</h1>
<el-button type="primary" @click="goToGoodsShow">返回首页</el-button>
    </div>
</template>

<script setup lang="ts">
import api from '@/api';
import router from '@/router';
import { onMounted, ref } from 'vue';
import { useRoute } from "vue-router"

const route = useRoute()

const urlParams = new URLSearchParams(window.location.search);
    const outTradeNo = urlParams.get('out_trade_no');

const paysuccess = ref({
    out_trade_no: outTradeNo
})

onMounted(() => {
      // 在组件挂载之后执行的逻辑
      api.orders.paySuccess(paysuccess.value.out_trade_no)
    });

function goToGoodsShow(){
    router.push('/showgoods')
}
</script>

<style scoped>

</style>